package edu.hubu.service.impl;

import edu.hubu.dao.impl.ITokenDao;
import edu.hubu.model.Token;
import net.moon.jpa.service.DefaultService;
import org.springframework.stereotype.Service;

/**
 * @author moonlan
 * @date 2020/10/27 上午10:11
 */
@Service
public class TokenService extends DefaultService<Token, String> {
    private final ITokenDao dao;

    public TokenService(ITokenDao dao) {
        super(dao, Token.class, "tokenIsDeleted", "tokenIsForbidden");
        this.dao = dao;
    }

    public Token findByTokenToken(String tokenToken) {
        return dao.findByTokenToken(tokenToken);
    }

    public Token findByUserId(String userId) {
        return dao.findByUserId(userId);
    }
}
